﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;

namespace SpaceShooter.GameObjects
{
    public class OrthographicCamera : ICamera
    {
        private Matrix projection;
        private Matrix view;

        public Vector3 LookAt { get; set; }

        public Vector3 Position { get; set; }

        public Vector3 Up { get; set; }

        public float FarPlaneDistance { get; set; }

        public float NearPlaneDistance { get; set; }

        public float Width { get; set; }

        public float Height { get; set; }

        public void UpdateMatrices()
        {
            this.view = Matrix.CreateLookAt(this.Position, this.LookAt, this.Up);
            this.projection = Matrix.CreateOrthographicOffCenter(0f, -this.Width, this.Height, 0f, this.NearPlaneDistance, this.FarPlaneDistance);
        }

        public Matrix Projection
        {
            get { return this.projection; }
        }

        public Matrix View
        {
            get { return this.view; }
        }
    }
}
